<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>首页</title>

   <!-- <link href="css/amazeui.css" rel="stylesheet" type="text/css" />-->
    <link href="css/admin.css" rel="stylesheet" type="text/css" />
    <link href="css/demo.css" rel="stylesheet" type="text/css" />
    <link href="css/hmstyle.css" rel="stylesheet" type="text/css" />
    <link href="css/skin.css" rel="stylesheet" type="text/css" />
    <link href="/css/all.css" rel="stylesheet"/>
    <link href="/css/movie/searchMovieResult.css" rel="stylesheet"/>
    <script src="/js/jquery-3.2.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/amazeui.min.js"></script>
    <link rel="icon" href="/image/title.ico"/>

    <link href="/css/setting/AccountSettings.css" rel="stylesheet"/>
    <link href="/css/all.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="/css/setting/datedropper.css"/>
    <link rel="stylesheet" type="text/css" href="/css/setting/timedropper.min.css"/>

</head>

<body>
<script src="/js/jquery-3.2.js"></script>
<script src="/js/setting/AccountSetting.js"></script>
<script src="/js/setting/newsArea.js"></script>
<script src="/js/setting/areaSec.js"></script>
<script>
    $(function () {
        $.areaSelect({
            id: 'address'
        });
    })
</script>
<div id="container">
    <div class="hmtop">

        <!--顶部导航条 -->
        <div class="am-container header">
            <ul class="message-l">
                <div class="topMessage">
                    <div class="menu-hd" v-if="isLogin" th:text="${userName}"  >
                        {{username}},欢迎您
                    </div>
                </div>
            </ul>
            <ul class="message-r">

                <div class="topMessage my-shangcheng">
                    <div class="menu-hd MyShangcheng"><a href="accountSettings" target="_top"><i
                            class="am-icon-user am-icon-fw"></i>个人中心</a></div>
                </div>
                <div class="topMessage mini-cart">
                    <div class="menu-hd"><a id="mc-menu-hd" href="myOrderMsg" target="_top"><i
                            class="am-icon-shopping-cart  am-icon-fw"></i><span>我的订单</span><strong
                            id="J_MiniCartNum" class="h"></strong></a></div>
                </div>

            </ul>
        </div>

        <!--悬浮搜索框-->

        <div class="nav white">

            <div class="logoBig">
                <!--<img src="images/logo.png" style="margin-left: 0px">-->
            </div>

            <div class="search-bar pr">
                <a name="index_none_header_sysc" href="#"></a>
                <form action="shop.html">
                    <input id="searchInput" v-model="keyword" name="index_none_header_sysc" type="text" placeholder="搜索"
                           autocomplete="off">
                    <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="button" @click="toSearch">
                </form>
            </div>
        </div>

        <div class="clear"></div>

        <div class="banner">
            <!--轮播 -->
            <div class="am-slider am-slider-default scoll" data-am-flexslider id="demo-slider-0">
                <ul class="am-slides">
                    <!-- <li class="banner1"><a href="introduction.html"><img src="static/images/ad1.jpg" /></a></li>
                <li class="banner2"><a><img src="static/images/ad2.jpg" /></a></li>
                <li class="banner3"><a><img src="static/images/ad3.jpg" /></a></li>
                <li class="banner4"><a><img src="static/images/ad4.jpg" /></a></li> -->
                    <li v-for="(img,index) in indexImgs" :class="'banner'+(index+1)">
                        <a><img :src="'images/'+img.imgUrl"></a>
                    </li>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
        <div class="shopNav">
            <div class="slideall">

                <div class="nav-cont">
                    <ul>
                        <li class="index"><a href="#">首页</a></li>
                        <li class="qc"><a href="#">闪购</a></li>
                        <li class="qc"><a href="allGoods">限时抢</a></li>
                        <li class="qc"><a href="#">团购</a></li>
                    </ul>

                </div>


                <div class="all_content">
                    <main>
                        <div class="all_main">
                            <div class="information currentSet">
                                我的信息
                            </div>
                            <div class="bottom-line"></div>


                            <div class="">
                                &nbsp;
                            </div>
                            <div class="">
                                &nbsp;
                            </div>
                            <div class="">
                                &nbsp;
                            </div>
                        </div>
                        <div class="main" style="display: block;">
                            <div class="all">我的信息</div>
                            <div class="name">
                                <label>
                    <span class="username">
                        昵称 &nbsp;&nbsp;
                    </span>
                                    <span class="name-center" th:text="${userInfo.name}">
                        wanzhenyu
                    </span>
                                </label>
                                <span class="name-modify">
                    修改
                </span>
                            </div>
                            <div class="set-name">
                                <div class="now-name">
                    <span class="">
                        现昵称
                    </span>
                                    <span class="now-name" th:text="${userInfo.name}">
                        wsk1103
                    </span>
                                </div>
                                <form action="/modified" method="post">
                                    <div class="new-name">
                        <span class="">
                            新昵称
                        </span>
                                        <input type="text" name="name" class="new-name-text" maxlength="11" minlength="4"/>
                                        <br/>
                                        <span class="name-tip">
                        </span>
                                    </div>
                                    <input type="submit" value="保存" class="preservation"/>
                                    <input type="button" value="关闭" class="close"/>
                                </form>
                            </div>

                            <div class="sex">
                                <label>
                    <span class="usersex">
                        性别&nbsp;&nbsp;
                    </span>
                                    <span class="sex-center" th:text="${userInfo.sex}">
                        男
                    </span>
                                    <span class="sex-modify">
                        修改
                    </span>
                                </label>
                            </div>
                            <div class="set-sex">
                                <form action="/modified" method="post">
                                    <div class="select">
                                    <span>
                                        性别选择
                                    </span>
                                        <input type="radio" value="男" name="sex" checked="checked" class="select-sex"/>男
                                        <input type="radio" value="女" name="sex" class="select-sex"/>女
                                    </div>
                                    <input type="submit" value="保存" class="sex-preservation"/>
                                    <input type="button" value="关闭" class="sex-close"/>
                                </form>
                            </div>
                            <div class="birth">
                                <label>
                            <span class="userbirth">
                                生日&nbsp;&nbsp;
                            </span>
                                    <span class="birth--center" th:with="birthday=${userInfo.birthday}" th:text="${#dates.format(birthday,'yyyy-MM-dd')}">
                                1999-9-25
                            </span>
                                </label>
                                <span class="birth-modify">
                            修改
                        </span>
                            </div>
                            <div>
                                <form action="/modified" method="post">
                                    <div class="set-birth">
                                        <p>
                                            请选择日期：
                                            <input type="text" class="input" id="pickdate" name="birth"/>
                                        </p>
                                        <br/>
                                        <input type="submit" value="保存" class="birth-preservation"/>
                                        <input type="button" value="关闭" class="birth-close"/>
                                    </div>
                                </form>
                            </div>
                            <div class="introduction">
                                <label>
                        <span class="userintroduction">
                            详细地址&nbsp;&nbsp;
                        </span>
                                    <span class="introduction-center" th:text="${userInfo.autograph}">
                        </span>
                                </label>
                                <span class="introduction-modify">
                        修改
                    </span>
                            </div>
                            <div class="set-introduction">
                                <form action="/modified" method="post">
                                    <div>
                                        <div class="now-introduction">
                                <span>
                                    详细地址
                                </span>
                                            <span class="now-introduction" th:text="${userInfo.autograph}">
                                </span>
                                        </div>
                                        <div class="new-introduction">
                                <span>
                                    新详细地址
                                </span>
                                            <textarea class="introduction-text" name="introduction" rows="10" cols="30" maxlength="50"></textarea>
                                        </div>
                                        <div>
                                <span class="introduction-tip">
                                </span>
                                        </div>
                                        <input type="submit" value="保存" class="introduction-preservation"/>
                                        <input type="button" value="关闭" class="introduction-close"/>
                                    </div>
                                </form>
                            </div>
                            <div class="address">
                                <label>
                        <span class="useraddress">
                            收货地址&nbsp;&nbsp;
                        </span>
                                    <sapn class="address-center" th:text="${userInfo.address}">
                                    </sapn>
                                    <span class="address-modify">
                            修改
                        </span>
                                </label>
                            </div>
                            <div class="set-address">
                                <form action="/modified" method="post">
                                    <div>
                                        <input type="text" id="address" autocomplete="off" readonly="readonly" class="u-ipt u-ipt-lg" value="请选择城市" name="city"/>
                                    </div>
                                    <input type="submit" value="保存" class="address-preservation"/>
                                    <input type="button" value="关闭" class="address-close"/>
                                </form>
                            </div>
                        </div>
                    </main>
                    <!-- <aside th:include="ui/aside :: aside"></aside>-->
                </div>

                <!--轮播-->

                <script type="text/javascript">
                    (function () {
                        $('.am-slider').flexslider();  //让轮播图“动起来”
                    });
                    $(document).ready(function () {
                        //让分类列表动起来
                        $("li").hover(function () {
                            $(".category-content .category-list li.first .menu-in").css("display", "none");
                            $(".category-content .category-list li.first").removeClass("hover");
                            $(this).addClass("hover");
                            $(this).children("div.menu-in").css("display", "block")
                        }, function () {
                            $(this).removeClass("hover")
                            $(this).children("div.menu-in").css("display", "none")
                        });
                    })
                </script>




                <!--走马灯 -->


                <div class="clear"></div>
            </div>
            <script type="text/javascript">
                if ($(window).width() < 640) {
                    function autoScroll(obj) {
                        $(obj).find("ul").animate({
                            marginTop: "-39px"
                        }, 500, function () {
                            $(this).css({
                                marginTop: "0px"
                            }).find("li:first").appendTo(this);
                        })
                    }
                    $(function () {
                        setInterval('autoScroll(".demo")', 3000);
                    })
                }
            </script>
        </div>
        <div class="shopMainbg">
            <div class="shopMain" id="shopmain">

                <!--今日推荐 -->

                <div class="clear "></div>
                <!--热门活动 -->


                <div class="clear"></div>








            </div>

        </div>
        <!--引导 -->
        <div class="navCir">
            <li class="active"><a href="home.html"><i class="am-icon-home "></i>首页</a></li>
            <li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
            <li><a href="myOrderMsg"><i class="am-icon-shopping-basket"></i>我的订单</a></li>
            <li><a href="person/index.html"><i class="am-icon-user"></i>我的</a></li>
        </div>




    </div>


    <script>
        window.jQuery || document.write('<script src="js/jquery.min.js "><\/script>');
    </script>
    <script type="text/javascript " src="js/quick_links.js "></script>

    <script type="text/javascript" src="js/cookie_utils.js"></script>
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript" src="js/axios.min.js"></script>
    <script type="text/javascript" src="js/base.js"></script>

    <script type="text/javascript">
        var vm = new Vue({
            el: "#container",
            data: {
                username: "",
                userImg: "",
                token: "",
                isLogin: false,
                indexImgs: [],
                categories: [],
                recommends:[],
                recommendCategories:[],
                keyword:""
            },
            created: function () {
                //在页面加载之前就获取相关信息
                //1.从cookie中获取token、username、userimg
                var token = getCookieValue("token");
                if (token != null && token != "") {
                    this.isLogin = true;
                    this.username = getCookieValue("username");
                    this.userImg = getCookieValue("userImg");
                }
                //2.轮播图显示
                var url = baseUrl + "/index/img";
                axios.get(url).then((res) => {
                    var vo = res.data;
                    this.indexImgs = vo.data;
                    // console.log(this.indexImgs);
                    //渲染轮播图
                    //初始化轮播图动画效果
                    setTimeout(function () {
                        $('.am-slider').flexslider();
                    }, 100)
                })

                //3.分类列表
                var url2 = baseUrl + "/index/category-list";
                axios({
                    method: "get",
                    url: url2
                }).then((res) => {
                    // console.log(res.data.data);
                    this.categories = res.data.data;
                    //初始化分类列表的动画效果
                    setTimeout(function () {
                        $("li").hover(function () {
                            $(".category-content .category-list li.first .menu-in").css("display", "none");
                            $(".category-content .category-list li.first").removeClass("hover");
                            $(this).addClass("hover");
                            $(this).children("div.menu-in").css("display", "block")
                        }, function () {
                            $(this).removeClass("hover")
                            $(this).children("div.menu-in").css("display", "none")
                        });
                    },100)
                })

                //4.新品推荐
                var url3 = baseUrl + "/index/recommend";
                axios.get(url3).then((res) => {
                    var vo = res.data;
                    // console.log(vo);
                    this.recommends = vo.data;
                    // console.log(this.recommends);
                })

                //5.分类商品推荐
                var url4 = baseUrl + "/index/recommend-first-level";
                axios.get(url4).then((res) => {
                    // console.log(res.data.data);
                    this.recommendCategories = res.data.data;
                })
            },
            methods:{
                toSearch:function(){
                    var url = "search.html?keyword=" + this.keyword;
                    window.location.href = encodeURI(url);
                }
            }
        })


    </script>

</body>
<div>
    <button class="go_to_top" value="" style="top: 0px;
    position: fixed;
    right: 0px;
    display: inline-block;"></button>
</div>
</footer>
<script src="/js/setting/datedropper.min.js"></script>
<script src="/js/setting/timedropper.min.js"></script>
<script>
    $("#pickdate").dateDropper({
        animate: false,
        format: 'Y-m-d',
        maxYear: '2050'
    });
</script>
<script>
    window.onload = init('province', 'city');
</script>
</html>